/*
 * Copyright (C) 2006-2012 TongYan Corporation
 * All rights reserved.
 *
 * @brief info:
 *
 * @author: 王哲成 - wangzhecheng@yeah.net
 * @date: 2021.05.19
 * @last modified: 2021-05-19 14:55
 *
 */

#ifndef __PARAM_MANAGER_HEADER__
#define __PARAM_MANAGER_HEADER__

#include "Types.hpp"
#include <string>
#include <vector>

/* typedef std::vector<Param> ParamSet; */

class ParamSet {
public:
  ParamSet() = default;
  ~ParamSet() = default;

  void append(const std::string &name, const double &lbound,
              const double &ubound, const size_t &nstep = 100);

  size_t size() const;

  // 按索引号搜索第n维的增量(求差分用)
  double dx(const size_t &n) const;
  // 按名称搜索第n维的增量(求差分用)
  double dx(const std::string &name) const;
  // 返回增量向量(求差分用)
  Vector dx() const;

  // 按索引号搜索第n维的定义域上限(生成随机点用)
  double uBound(const size_t &n) const;
  // 按名称搜索第n维的定义域上限(生成随机点用)
  double uBound(const std::string &name) const;

  // 按索引号搜索第n维的定义域下限(生成随机点用)
  double lBound(const size_t &n) const;
  // 按名称搜索第n维的定义域下限(生成随机点用)
  double lBound(const std::string &name) const;

private:
  std::vector<std::string> m_vecstrName;
  Vector m_dDelta;
  Vector m_dUBound;
  Vector m_dLBound;
};

/* class Param { */
/* public: */
/*   Param() = delete; */
/*   Param(const std::string &name, const double &ubound, const double &lbound,
 */
/*         const double &step) */
/*       : m_strName{name}, m_UBound{ubound}, m_LBound{lbound}, m_dStep{step} {}
 */
/*   Param(const std::string &name, const double &ubound, const double &lbound,
 */
/*         const int &nstep = 100) */
/*       : m_strName{name}, m_UBound{ubound}, m_LBound{lbound}, m_dStep{(ubound
 * - */
/*                                                                       lbound)
 * / */
/*                                                                      nstep}
 * {} */
/*   Param(const Param &) = default; */
/*   ~Param() = default; */

/*   Param &operator=(const Param &rhs) = default; */

/*   // 设定步进大小 */
/*   void setStep(const double &v) { */
/*     m_dStep = v; */
/*     return; */
/*   } */
/*   // 返回步进大小 */
/*   double getStep() const { return m_dStep; } */

/*   void setLowerBoundary(const double &v) { m_LBound = v; } */
/*   double getLowerBoundary() const { return m_LBound; } */

/*   void setUpperBoundary(const double &v) { m_UBound = v; } */
/*   double getUpperBoundary() const { return m_UBound; } */

/*   void setName(const std::string &name) { m_strName = name; } */
/*   std::string getName() const { return m_strName; } */

/* private: */
/*   std::string m_strName; */
/*   double m_UBound; */
/*   double m_LBound; */
/*   double m_dStep; */
/* }; */

#endif
